home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / LockedHeap.h,v < prev    next >
Text File  |  1989-02-23  |  2KB  |  127 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.35.49;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.50.00;  author grunwald;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     88.10.30.13.05.53;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     88.09.18.16.42.10;  author grunwald;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @@
  32.  
  33.  
  34. 3.2
  35. log
  36. @Start using Gnu library heaps for schedulers
  37. @
  38. text
  39. @// This may look like C code, but it is really -*- C++ -*-
  40. // 
  41. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  42. //
  43. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  44. //
  45. #ifndef LOCKEDHEAPH
  46. #define LOCKEDHEAPH
  47.  
  48. #include "Semaphore.h"
  49. #include "AwesimeHeap.h"
  50.  
  51. class LockedHeap : public AwesimeHeap {
  52.  
  53. protected:
  54.     Semaphore heapLock;
  55. public:
  56.  
  57.     inline LockedHeap(int defaultLength = 0)
  58.     : (defaultLength), heapLock(1) {
  59.         //
  60.         // do nothing
  61.         //
  62.     }
  63.  
  64.     //
  65.     // Operations on the list -- these simply lock the list and
  66.     // then use the AwesimeHeap routines to perform the action.
  67.     //
  68.     virtual void add(AwesimeHeapItem & t);
  69.     virtual bool remove(AwesimeHeapItem & item);
  70.  
  71.     //
  72.     // Over-ride the doStart and doDone; these use the semaphore
  73.     // to lock out other threads.
  74.     //
  75.  
  76.     virtual bool doStart( AwesimeHeapIndex& index);
  77.     virtual void doDone();
  78.  
  79.     //
  80.     // The size and printer also locks out other threads.
  81.     //
  82.     virtual unsigned int size();
  83.     virtual void classPrintOn(ostream& s);
  84. };
  85.              
  86. #endif LOCKEDHEAPH
  87. @
  88.  
  89.  
  90. 3.1
  91. log
  92. @Steay version
  93. @
  94. text
  95. @@
  96.  
  97.  
  98. 1.2
  99. log
  100. @*** empty log message ***
  101. @
  102. text
  103. @d16 1
  104. a16 1
  105.     Semaphore fifoLock;
  106. d20 1
  107. a20 1
  108.     : (defaultLength), fifoLock(1) {
  109. d30 2
  110. a31 3
  111.     virtual void add(AwesimeHeapItem *t);
  112.     virtual bool remove(AwesimeHeapItem *item);
  113.     virtual bool removeIfFound(AwesimeHeapItem* item);
  114. d38 1
  115. a38 1
  116.     virtual bool doStart( AwesimeHeapIndex& index, AwesimeHeapItem* item);
  117. @
  118.  
  119.  
  120. 1.1
  121. log
  122. @Initial revision
  123. @
  124. text
  125. @d1 6
  126. @
  127.